package per.turtle.system.feign.factory;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import per.turtle.system.feign.RemoteRoleService;
import per.turtle.system.feign.fallback.RemoteRoleFallbackImpl;

/**
 * 角色服务降级处理
 *
 * @author turtle
 */
@Component
public class RemoteRoleFallbackFactory implements FallbackFactory<RemoteRoleService> {

    @Override
    public RemoteRoleService create(Throwable throwable) {
        RemoteRoleFallbackImpl fallback = new RemoteRoleFallbackImpl();
        fallback.setCause(throwable);
        return fallback;
    }

}
